import pygame
import setting

import Bullet
import game_function as gf
from charter import person


def run_game():
    pygame.init()
    ai_setting = setting.Setting()
    screen = pygame.display.set_mode((ai_setting.screen_width, ai_setting.screen_high))
    charter = person(ai_setting, screen)  # 创建人物
    bullet = Bullet.Bullet(ai_setting, screen, charter)  # 创造子弹的编著
    pygame.display.set_caption("我是fw")
    clock = pygame.time.Clock()
    while True:  # 游戏循环
        clock.tick(60)
        gf.check_event(charter, bullet)
        charter.gravity()
        charter.update()
        bullet.update()
        gf.update_screen(ai_setting, screen, charter, bullet)


run_game()
